<include file="Public:pagerForm" />
<!-- 主页面开始 -->
<div id="main" class="main" >
    <SCRIPT LANGUAGE="JavaScript">
        <!--
        function listColumn(id){
            window.location = '__URL__/index/column_id/'+id;
        }
        function selectColumn(){
            var result= PopModalWindow('__APP__/Column/treeSelect/',268,365);
            if(typeof(result) == "undefined") return;
            $('columnName').value=result[0][0];
            $('column_id').value=result[0][1];
        }
  
        //-->
    </SCRIPT>
    
    <script>
    	function addcart(strSection){
				var i;
				var ids='';
				var	colInputs = document.getElementById(strSection).getElementsByTagName("input");
				for	(i=1; i < colInputs.length; i++)
				{
					//colInputs[i].checked=colInputs[0].checked;
					if(colInputs[i].checked==true){
						//alert(colInputs[i].value);
						if(ids==''){
							ids=colInputs[i].value;
						}else {
							ids=ids+'_'+colInputs[i].value;
						}
					}
				}
				//alert(ids);
				//下面使用thinkajax
				//ajax提交待后台最后做先使用window.open 替代
				if(ids!=''){
					window.open('__URL__/add_cart/ids/'+ids);
				}else{
					alert('请先勾选要添加操作的产品');
				}
		}
    </script>
    <!-- 主体内容  -->
    <div class="content" >
        <div class="title">产品资料 </div>
        <!--  功能操作区域  -->
        <div class="operate" >
            <html:imageBtn name="add" value="新增" click="add()" style="impBtn hMargin fLeft shadow" />
            <html:imageBtn name="edit" value="编辑" click="edit()" style="impBtn hMargin fLeft shadow" />
            <html:imageBtn name="delete" value="删除" click="del()" style="impBtn hMargin fLeft shadow" />
            <html:imageBtn name="sort" value="排序" click="sort()" style="impBtn hMargin fLeft shadow" />
            <html:imageBtn name="addcart" value="添加" click="addcart('checkList')" style="impBtn hMargin fLeft shadow" />
            <!-- 查询区域 -->
            <div class="fRig">
                <FORM METHOD=POST name="search" ACTION="" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)" >
                    <div class="fLeft"><span id="key"><INPUT TYPE="text" NAME="title" title="标题查询" class="medium" ></span></div>
                    <html:imageBtn type="submit" name="search" value="查询" style="impBtn hMargin fLeft shadow" />
            </div>
            <!-- 高级查询区域 -->
            <div  id="searchM" class=" none search cBoth" >
            </div>
            </FORM>
        </div>
        <!-- 功能操作区域结束 -->
        <!-- 列表显示区域  -->
        <div class="list" >
        <form name="shenggou" enctype="application/x-www-form-urlencoded" method="post"  action="__URL__/test" >
<table width="100%" border="0">
  <tr>
    <td>产品名称</td>
    <td>产品编号</td>
    <td>进货价</td>
    <td>进货数量</td>
    <td>操作</td>
  </tr>
	<volist name="list" id="data">
  <tr id="{$data.id}">
    <td>{$data.product_name}</td>
    <td>{$data.product_code}</td>
    <td>{$data.price}</td>
    <td><input type="text" name="c[{$data.id}]" /></td>
    <td><a href="javascript:void(0);" onclick="removeitem({$data.id})">移除</a></td>
  </tr>
	</volist>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><input type="submit" name="button" id="button" value="提交" />
      <input type="reset" name="button2" id="button2" value="重置" /></td>
    <td>&nbsp;</td>
  </tr>
</table>
</form>
        </div>
        <!--  分页显示区域 -->
        <div class="page">{$page}</div>
        <!-- 列表显示区域结束 -->
    </div>
    <!-- 主体内容结束 -->
</div>
<!-- 主页面结束 -->